#!/bin/bash
# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jaewon

set -e

COIN_DEPLOY_DIR="/remote/iosg/home/jaewon/ops/bitmex/coin_deploy"
VENV="/remote/iosg/home/jaewon/venv"

CONFIG_FILE="${1}"
if [ ! -f "${CONFIG_FILE}" ]; then
  (>&2 echo "Error: config file is not given.")
  exit 1
fi

source "${VENV}/bin/activate"
cd "${COIN_DEPLOY_DIR}"
./fab.sh -f bitmex_mm/fabfile.py -P "update_config:config=${CONFIG_FILE},remote_config_name=bitmex-pass-unhedge.yaml"
